﻿<Window x:Class="Microsoft.Research.ScientificWorkflow.ManagementStudioControls.RegistryManagerModule.AddCredential"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	Width="400" Height="180" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
        WindowStyle="None" Background="{x:Null}" ResizeMode="NoResize" ShowInTaskbar="False"  WindowStartupLocation="CenterOwner" AllowsTransparency="True" 
        Name="AddCredentialWindow"
        Loaded="OnLoaded">
  
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="VisibilityConverter"></BooleanToVisibilityConverter>
        <Style x:Key="PopupCloseButton" BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <Rectangle Fill="#FFCCCCCC" Stroke="{x:Null}" RadiusX="4.5" RadiusY="4.5" x:Name="rectangle"/>
                            <Rectangle Fill="#FF4F4F4F" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Margin="8,3.5,7,3.5" RenderTransformOrigin="0.5,0.5">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="-34.039"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                            <Rectangle Fill="#FF4F4F4F" Stroke="{x:Null}" RadiusX="0" RadiusY="0" RenderTransformOrigin="0.5,0.5" Margin="8,3.5,7,3.5">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="-1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="34.039"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Fill" TargetName="rectangle" Value="#FFADADAD"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True"/>
                            <Trigger Property="IsEnabled" Value="False"/>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="TextBoxControlTemplate1" TargetType="{x:Type TextBox}">
            <Grid>
                <Border HorizontalAlignment="Stretch" Background="#FFFFFFFF" BorderBrush="#FFC8C8C8" CornerRadius="2,0,0,2" BorderThickness="1,1,0,1">
                    <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                </Border>
            </Grid>
        </ControlTemplate>
    </Window.Resources>

    <Grid x:Name="LayoutRoot" Background="{x:Null}" >
        <Border BorderBrush="#FFBDBDBD" BorderThickness="1,1,2,2" CornerRadius="4,4,4,4" Margin="0,0,0,0">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFF7F7F7" Offset="0"/>
                    <GradientStop Color="#FFF1F1F1" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="28"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="38"/>
                </Grid.RowDefinitions>
                <Border Name="brdrHeader" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Grid.Row="0" CornerRadius="4,4,0,0">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF7F7F7" Offset="0"/>
                            <GradientStop Color="#FFE9E9E9" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <Grid>
                        <TextBlock HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center" 
                                   FontSize="14" Foreground="#FF5F5F5F" 
                                   Text="{Binding Path=CredentialTitle}" TextWrapping="Wrap"/>
						<Button HorizontalAlignment="Right" Margin="0,5.5,5,5.5" Style="{DynamicResource PopupCloseButton}" Width="17" Content="Button" Command="{Binding Path=CancelCommand}"/>
					</Grid>
                </Border>
                <Button IsCancel="True" TabIndex="3" HorizontalAlignment="Right" Width="70" Content="Cancel" Margin="0,0,10,0" VerticalAlignment="Center" Grid.Row="2" Command="{Binding Path=CancelCommand}"/>
                <Button IsDefault="True" TabIndex="2" HorizontalAlignment="Left" Width="70" Content="OK" Margin="220,0,0,0" VerticalAlignment="Center" Grid.Row="2" d:LayoutOverrides="Height" Command="{Binding Path=AddCommand}" Height="21.96" />
                <Border Grid.Row="1" Background="#FFFFFFFF">
                    <Grid VerticalAlignment="Top">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="139.827"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock HorizontalAlignment="Right" Text="{Binding Path=CredentialLabel}" TextWrapping="Wrap" Grid.Row="0" VerticalAlignment="Top" Margin="14,7,0,0"/>
						<TextBox Focusable="True" Text="{Binding Path=EditableCredentialModel.Name , UpdateSourceTrigger=PropertyChanged}" TextChanged="OnNameChanged" TextWrapping="NoWrap" IsEnabled="True" Grid.Column="1" Grid.Row="0" d:LayoutOverrides="Height" VerticalAlignment="Top" HorizontalAlignment="Left" Width="150" Margin="0,5,0,0" TabIndex="0" Name="txtName"/>
						<Button TabIndex="1" Content="Test" VerticalAlignment="Bottom" Grid.Column="1" Grid.Row="0" Width="70" HorizontalAlignment="Left" Margin="155,0,0,0" Command="{Binding Path=TestCommand}"/>
						<TextBlock HorizontalAlignment="Right" Text="Authentication Mode:" TextWrapping="Wrap" Margin="0,5,5,0" Grid.Row="1" d:LayoutOverrides="Height" VerticalAlignment="Top"/>
                        <TextBlock HorizontalAlignment="Left" Text="Windows Directory" TextWrapping="Wrap" Margin="0,5,5,0" Grid.Column="1" Grid.Row="1" d:LayoutOverrides="Height" VerticalAlignment="Top"/>
                        <TextBlock HorizontalAlignment="Left" Text="Display name: " TextWrapping="Wrap" Margin="61,5,5,0" Grid.Column="0" Grid.Row="2" VerticalAlignment="Top"/>
                        <TextBlock HorizontalAlignment="Left" Text="{Binding Path=EditableCredentialModel.DisplayName}" TextWrapping="Wrap" Margin="0,5,5,0" Grid.Column="1" Grid.Row="2" d:LayoutOverrides="Height" VerticalAlignment="Top"/>
                        
                        <StackPanel HorizontalAlignment="Left" Grid.Column="1" Grid.Row="3" Orientation="Horizontal" Grid.ColumnSpan="1" Margin="0,10,0,0">
							<Grid Visibility="{Binding Path=EditableCredentialModel.IsTestFailed, Converter={StaticResource VisibilityConverter}}">
								<Grid Width="26" Visibility="Visible" HorizontalAlignment="Left" VerticalAlignment="Center">
									<Ellipse Margin="0,2.728,7.037,0" Stroke="#FFE4E4E4">
										<Ellipse.Fill>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FFF7F7F7" Offset="0"/>
												<GradientStop Color="#FFDADADA" Offset="1"/>
											</LinearGradientBrush>
										</Ellipse.Fill>
									</Ellipse>
									<Path Margin="5.377,0.375,1.75,1.833" Stretch="Fill" Stroke="#FFFFFFFF" Data="M36.193294,39.977778 L42.369524,45.900094 37.74555,52.420959 40.538682,54.351786 46.024899,49.18505 51.919421,53.386046 53.252633,50.956781 48.655623,45.889429 54.088817,37.699271 51.710917,35.882634 44.883899,42.98123 38.055305,38.26152 z">
										<Path.Fill>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FFFF9067" Offset="0"/>
												<GradientStop Color="#FFD04301" Offset="1"/>
											</LinearGradientBrush>
										</Path.Fill>
									</Path>
								</Grid>
								<TextBlock Text="Test failed" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" Padding="5,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="26,0,0,0"/>
							</Grid>
							<Grid Visibility="{Binding Path=EditableCredentialModel.IsTestSucceeded, Converter={StaticResource VisibilityConverter}}">
								<Grid Width="26" HorizontalAlignment="Left" >
									<Ellipse Margin="0,2.728,7.037,0" Stroke="#FFE4E4E4">
										<Ellipse.Fill>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FFF7F7F7" Offset="0"/>
												<GradientStop Color="#FFDADADA" Offset="1"/>
											</LinearGradientBrush>
										</Ellipse.Fill>
									</Ellipse>
									<Path Margin="3.026,0,0,3.03" Stretch="Fill" Stroke="#FFFFFFFF" Data="M33.840121,45.952707 L42.595503,53.109551 55.840955,36.429609 53.503676,35.493353 42.987521,45.952707 35.539182,42.959845 z">
										<Path.Fill>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FF8BF28D" Offset="0"/>
												<GradientStop Color="#FF218623" Offset="1"/>
											</LinearGradientBrush>
										</Path.Fill>
									</Path>
								</Grid>
								<TextBlock Text="Test passed" TextWrapping="Wrap" Padding="5,0,0,0" HorizontalAlignment="Left" d:LayoutOverrides="Height" VerticalAlignment="Center" Margin="26,0,0,0"/>
							</Grid>
						</StackPanel>
					</Grid>
                </Border>
            </Grid>
        </Border>
    </Grid>
</Window>


